package main.java.cn.wolfcode.qo;

import cn.hutool.core.date.DateUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;

@Setter
@Getter
public class NoticeQueryObject extends QueryObject{
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private  Date endDate;
    private  Integer levelId;
    private  Boolean readId;

    public Date getEndDate(){
        if(endDate!=null){
            //设置当天的最晚时间
            return DateUtil.endOfDay(endDate);
        }
        return null;
    }

}
